package whf.shop.service;

import java.util.List;

import whf.framework.exception.FindException;
import whf.framework.exception.ServiceNotFoundException;
import whf.framework.util.BeanFactory;
import whf.shop.dao.DeliveryDAO;
import whf.shop.entity.Delivery;
import whf.shop.entity.Member;

/**
 * 服务对象具体实现，委托相应的dao对象实现相关操作
 * 
 * @author wanghaifeng
 * @email king@126.com
 * @modify 2007-01-11
 */
public class DeliveryServiceImp extends whf.framework.service.ServiceImp<Delivery>
		implements DeliveryService {

	private DeliveryDAO deliveryDAO;

	public void setDeliveryDAO(DeliveryDAO deliveryDAO) {
		this.deliveryDAO = deliveryDAO;
	}

	public static DeliveryService getDeliveryService()
			throws ServiceNotFoundException {
		return (DeliveryService) BeanFactory
				.getService(DeliveryServiceImp.class);
	}

	/* (non-Javadoc)
	 * @see whf.shop.service.DeliveryService#findByMember(whf.shop.entity.Member)
	 */
	public List<Delivery> findByMember(Member member) throws FindException {
		List<Delivery> result = this.deliveryDAO.find("t.member=? order by t.lastUpdate desc", member);
		return result;
	}

}